package com.tudouji.project.dept.service.impl;

import java.util.List;
import com.tudouji.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tudouji.project.dept.mapper.DeptStoreroomMapper;
import com.tudouji.project.dept.domain.DeptStoreroom;
import com.tudouji.project.dept.service.IDeptStoreroomService;

/**
 * 库房部门对照Service业务层处理
 * 
 * @author tudouji
 * @date 2024-04-11
 */
@Service
public class DeptStoreroomServiceImpl implements IDeptStoreroomService 
{
    @Autowired
    private DeptStoreroomMapper deptStoreroomMapper;

    /**
     * 查询库房部门对照
     * 
     * @param id 库房部门对照ID
     * @return 库房部门对照
     */
    @Override
    public DeptStoreroom selectDeptStoreroomById(Long id)
    {
        return deptStoreroomMapper.selectDeptStoreroomById(id);
    }

    /**
     * 查询库房部门对照列表
     * 
     * @param deptStoreroom 库房部门对照
     * @return 库房部门对照
     */
    @Override
    public List<DeptStoreroom> selectDeptStoreroomList(DeptStoreroom deptStoreroom)
    {
        return deptStoreroomMapper.selectDeptStoreroomList(deptStoreroom);
    }

    /**
     * 新增库房部门对照
     * 
     * @param deptStoreroom 库房部门对照
     * @return 结果
     */
    @Override
    public int insertDeptStoreroom(DeptStoreroom deptStoreroom)
    {
        deptStoreroom.setCreateTime(DateUtils.getNowDate());
        return deptStoreroomMapper.insertDeptStoreroom(deptStoreroom);
    }

    /**
     * 修改库房部门对照
     * 
     * @param deptStoreroom 库房部门对照
     * @return 结果
     */
    @Override
    public int updateDeptStoreroom(DeptStoreroom deptStoreroom)
    {
        deptStoreroom.setUpdateTime(DateUtils.getNowDate());
        return deptStoreroomMapper.updateDeptStoreroom(deptStoreroom);
    }

    /**
     * 批量删除库房部门对照
     * 
     * @param ids 需要删除的库房部门对照ID
     * @return 结果
     */
    @Override
    public int deleteDeptStoreroomByIds(Long[] ids)
    {
        return deptStoreroomMapper.deleteDeptStoreroomByIds(ids);
    }

    /**
     * 删除库房部门对照信息
     * 
     * @param id 库房部门对照ID
     * @return 结果
     */
    @Override
    public int deleteDeptStoreroomById(Long id)
    {
        return deptStoreroomMapper.deleteDeptStoreroomById(id);
    }
}
